package com.qf.api.point.fallback;

import com.qf.api.point.dto.PointDTO;
import com.qf.api.point.dto.PointRetryDTO;
import com.qf.api.point.feign.PointFeignService;
import com.qf.common.core.utils.R;



import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;



/**
 * @author zdl
 * @date 2025/3/27
 */
@Component
public class PointFallbackFactory implements FallbackFactory<PointFeignService> {
    @Override
    public PointFeignService create(Throwable cause) {
        return new PointFeignService() {
            @Override
            public R<?> remoteAddPoint(PointDTO pointDTO) {
                //log.error(cause.getMessage());
                return R.fail("调用远程接口添加积分失败");
            }

            @Override
            public R<?> remoteAddPoint2(Integer pointType) {
                //log.error(cause.getMessage());
                return R.fail("调用远程接口添加积分失败");
            }

            @Override
            public R<?> remoteAddPoint3(Integer pointType, Integer uid) {
                return R.fail("调用远程接口添加积分失败");
            }

            @Override
            public R<?> addPointRetry(PointRetryDTO pointRetryDTO) {
                return R.fail("调用远程添加积分补偿接口失败");
            }
        };
    }
}
